package org.itboys.core.service.mongo.front;

import org.itboys.core.common.SundayCommonConstants;
import org.itboys.core.entity.mongo.SundayCompanyInfo;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.ParamUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * Auther: 罗尧坤
 * Date: 2018/8/23
 * Description:
 */

@Service
public class SundayFrontCompanyInfoService extends BaseMongoService<SundayCompanyInfo> {
    @Resource(name = "mobileDs")
    private MongoDataSource mobileDataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return mobileDataSource;
    }
    @Override
    protected Class<SundayCompanyInfo> getEntityClass() {
        return SundayCompanyInfo.class;
    }

    /**
     * 分页查询
     * @param request
     * @return
     */
    public List<SundayCompanyInfo> select(HttpServletRequest request){
        Map<String, Object> param = ParamUtil.packageMongoExactParam(request);
        param.put("isDeleted", SundayCommonConstants.NO);
        return super.pageQuery(request,param).getData();
    }

}
